<?php
$act = isset($_REQUEST['act'])?$_REQUEST['act']:'';

if($act == 'delete_benzu_style')
{
	if($_REQUEST['benzu_styles'])
	{
		$dt = new DataTable(constant('DB_TABLE_BENZU_STYLE'));
		foreach($_REQUEST['benzu_styles'] as $tmpId)
		{
			$dt->remove(intval($tmpId));
		}
	}
}

if($act == 'delete_photo_size')
{
	if($_REQUEST['photo_size'])
	{
		$dt = new DataTable(constant('DB_TABLE_PHOTO_SIZE'));
		foreach($_REQUEST['photo_size'] as $tmpId)
		{
			$dt->remove(intval($tmpId));
		}
	}
}

if($act == 'delete_photo_frame')
{
	if($_REQUEST['photo_frame'])
	{
		$dt = new DataTable(constant('DB_TABLE_PHOTO_FRAME'));
		$dtPrice = new DataTable(constant('DB_TABLE_PHOTO_FRAME_PRICE'));
		foreach($_REQUEST['photo_frame'] as $tmpId)
		{
			$framedata = $dt->get($tmpId);
			if($framedata)
			{
				$dtPrice->removeByCondition("`photo_frame_id`=".$framedata['id']);
			}
			$dt->remove(intval($tmpId));
		}
	}
}


if($act == 'delete_gift')
{
	if($_REQUEST['gift'])
	{
		$dt = new DataTable(constant('DB_TABLE_GIFT'));
		foreach($_REQUEST['gift'] as $tmpId)
		{
			$dt->remove(intval($tmpId));
		}
	}
}
?>